﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<SDT.Model.Position>>" %>
<%@ Import Namespace="SDT.Lib.Helpers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Vị trí quảng cáo
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Header" runat="server">
	Vị trí quảng cáo
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="Message" runat="server">
    <%=ViewData["MessageInfo"]!=null? "<p class='perror'>"+Html.Encode(ViewData["MessageInfo"])+"</p>":string.Empty%> 
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Toolbar" runat="server">
	<%= Html.Toolbar("Thêm mới", "/Position/Create", "new") %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%if(ViewData["MessageInfo"]==null){ %>
	<form action="/Position" method="post" name="adminForm">
		<table width="100%" class="adminlist">
			<tr>
				<th width="30" align="right">
					STT
				</th>
				<th width="30"></th>
				<th width="30"></th>				
				<th>
					<%= Html.Sort("Vị trí", "Name", ViewData["orderDir"].ToString(), ViewData["order"].ToString())%>
				</th>
				<th>
					<%= Html.Sort("Chia sẻ?", "ShareYN", ViewData["orderDir"].ToString(), ViewData["order"].ToString())%>
				</th>				
				<th>
					<%= Html.Sort("ID", "ID", ViewData["orderDir"].ToString(), ViewData["order"].ToString())%>
				</th>
			</tr>
		<% 
			int i = 0;
    		foreach (var item in Model) {
				i++;
		%>		
			<tr>
				<td align="right">
					<%= i.ToString() %>
				</td>
				<td align="center">
					<%= Html.ActionImage("Sửa", "icon-24-edit.png", "Position", "Edit", new Dictionary<string, object>() { { "id", item.ID } })%>
				</td>
				 <td align="center">
					<%= Html.ActionImage("Xóa", "icon-24-delete.png", "Position", "Delete", new Dictionary<string, object>() { { "id", item.ID } })%>
				</td>				
				<td>
					<%= Html.Encode(item.Name)%>
				</td>	
				<td><%=item.ShareYN.HasValue && item.ShareYN.Value==true? "Có":"Không" %></td>			
				<td>
					<%= Html.Encode(item.ID)%>
				</td>
			</tr>
	    
		<% } %>

		</table>
		<%= Html.Hidden("order")%>
		<%= Html.Hidden("orderDir")%>
	</form>
<% } %>
</asp:Content>